package me.jessyan.armscomponent.app.mvp.model.api.service;

import java.util.List;

import io.reactivex.Observable;
import me.jessyan.armscomponent.app.mvp.model.entity.CollectRecord;
import me.jessyan.armscomponent.app.mvp.model.entity.College;
import me.jessyan.armscomponent.app.mvp.model.entity.LearnPlan;
import me.jessyan.armscomponent.app.mvp.model.entity.LearnPlanListItem;
import me.jessyan.armscomponent.app.mvp.model.entity.ListData;
import me.jessyan.armscomponent.app.mvp.model.entity.Scholar;
import me.jessyan.armscomponent.app.mvp.model.entity.Subject;
import me.jessyan.armscomponent.app.mvp.model.entity.addPlan;
import me.jessyan.armscomponent.app.mvp.model.entity.allClass;
import me.jessyan.armscomponent.app.mvp.model.entity.detailRecord;
import me.jessyan.armscomponent.app.mvp.model.entity.diyRecite;
import me.jessyan.armscomponent.app.mvp.model.entity.plan;
import me.jessyan.armscomponent.app.mvp.model.entity.planLog;
import me.jessyan.armscomponent.app.mvp.model.entity.recite;
import me.jessyan.armscomponent.app.mvp.model.entity.suggestLearn;
import me.jessyan.armscomponent.app.mvp.model.entity.timeSetting;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;

import static me.jessyan.retrofiturlmanager.RetrofitUrlManager.DOMAIN_NAME_HEADER;

/**
 * package: me.jessyan.armscomponent.app.mvp.model.api.service
 * author: Taozebi
 * datetime: 2021/9/27 18:12
 * describe: describe of this class
 */
public interface LearningService {
    String ZHIHU_DOMAIN_NAME = "zhihu";
    String ZHIHU_DOMAIN = "http://news-at.zhihu.com";
    /**
     * 最新日报
     */
    @Headers({DOMAIN_NAME_HEADER + ZHIHU_DOMAIN_NAME})
    @GET("/api/4/news/latest")
    Observable<plan> getDailyList();

    @Headers({DOMAIN_NAME_HEADER + ZHIHU_DOMAIN_NAME})
    @GET("/api/4/news/latest")
    Observable<recite> getReciteList();

    @Headers({DOMAIN_NAME_HEADER + ZHIHU_DOMAIN_NAME})
    @GET("/api/4/news/latest")
    Observable<planLog> getPlanLog();

    @Headers({DOMAIN_NAME_HEADER + ZHIHU_DOMAIN_NAME})
    @GET("/api/4/news/latest")
    Observable<timeSetting> getTimeSetting();

    @Headers({DOMAIN_NAME_HEADER + ZHIHU_DOMAIN_NAME})
    @GET("/api/4/news/latest")
    Observable<allClass> getAllClass();

    @Headers({DOMAIN_NAME_HEADER + ZHIHU_DOMAIN_NAME})
    @GET("/api/4/news/latest")
    Observable<diyRecite> getDiyRecite();

    @Headers({DOMAIN_NAME_HEADER + ZHIHU_DOMAIN_NAME})
    @GET("/api/4/news/latest")
    Observable<detailRecord> getDetailRecord();


    @Headers({DOMAIN_NAME_HEADER + ZHIHU_DOMAIN_NAME})
    @GET("/api/4/news/latest")
    Observable<suggestLearn> getSuggestLearn();


    @Headers({DOMAIN_NAME_HEADER + ZHIHU_DOMAIN_NAME})
    @GET("/api/4/news/latest")
    Observable<addPlan> getAddPlan();


    /**
     * 添加用户收藏记录
     * @return
     */
    @POST("/app/user/collect")
    Observable<Object> getCollectList(String itemId);

    /**
     * 获取用户收藏记录列表
     * @return
     */
    @GET("/app/user/collectList/")
    Observable<ListData<CollectRecord>> getCollectList(int limit, int offset, int itemType);

    /**
     * 删除用户收藏记录
     * @return
     */
    @DELETE("/app/user/collect/")
    Observable<Object> delCollect(int id);

    /**
     * 获取用户学习计划列表
     * @return
     */
    @GET("/app/studyPlan/list/")
    Observable<ListData<LearnPlanListItem>> getLearnPlanList(int limit, int offset, String subjectId, String collegeId);

    /**
     * 获取用户学习计划详情
     * @return
     */
    @GET("/app/studyPlan/detail/")
    Observable<LearnPlan> getLearnPlanDetail(String studyPlanId);

    /**
     * 根据名称模糊搜索学习计划
     * @return
     */
//    @GET("/app/studyPlan/search/")
//    Observable<ListData<CollectRecord>> getLearnPlan(String name, int limit, int offset);

    /**
     * 获取学院列表
     * @return
     */
    @GET("/app/college/list")
    Observable<List<College>> getCollegeList();

    /**
     * 获取学科列表
     * @return
     */
    @GET("/app/subject/list")
    Observable<List<Subject>> getSubjectList();

    /**
     * 获取学者列表
     * @return
     */
    @GET("/app/scholar/list")
    Observable<List<Scholar>> getScholarList();
}
